package com.gk.init.model
{
	import com.gk.company.control.event.UpdateUserInfoEvent;
	import com.gk.init.model.vo.UserInfoVo;
	
	import org.robotlegs.mvcs.Actor;

	/**
	 *用户信息数据 模型
	 * @author Nestor
	 * 
	 */	
	public class UserInfoModel extends Actor
	{
		/**
		 *用户个人基本信息 
		 */		
		private var _userInfo:UserInfoVo;
		/**
		 *用户好友信息 
		 */		
		private var _friendInfo:Vector.<UserInfoVo>;
	

		
		public function UserInfoModel()
		{
			_userInfo = new UserInfoVo();
			super();
		}

		/**
		 *更改金币数 
		 * 
		 */		
		public function changeMb(value:int):void{
			this._userInfo.mbNum += value;
			dispatch(new UpdateUserInfoEvent(UpdateUserInfoEvent.UPDATE_USER_MB,_userInfo));
		}
		
		/**
		 *更改K币数 
		 * 
		 */		
		public function changeKb(value:int):void{
			this._userInfo.kbNum += value;
			dispatch(new UpdateUserInfoEvent(UpdateUserInfoEvent.UPDATE_USER_KB,_userInfo));
		}
		
		
		/**
		 *更改知名度
		 * 
		 */		
		public function changePopular(value:int):void{
			this._userInfo.popularNum += value;
			dispatch(new UpdateUserInfoEvent(UpdateUserInfoEvent.UPDATE_USER_POPULAR,_userInfo));
		}
		
		
		
		
		//#++++++++++    GET & SET    +++++++++++++
		
		
		public function get userInfo():UserInfoVo
		{
			return _userInfo;
		}

		public function get friendInfo():Vector.<UserInfoVo>
		{
			return _friendInfo;
		}

		public function set friendInfo(value:Vector.<UserInfoVo>):void
		{
			_friendInfo = value;
		}

	}
}